Skip to content

Conversation

@oncsr
Copy link
Contributor

@oncsr oncsr commented Apr 7, 2025

🧷 문제 링크

https://www.acmicpc.net/problem/23748

🧭 풀이 시간

26분

👀 체감 난이도

✏️ 문제 설명

두 제품을 적어도 각각 X, Y이상 팔아야 한다.
N명의 고객 각각에게 판매 성공 시, 해당 고객은 두 제품을 x[i], y[i]만큼 구매한다.

할당량을 넘기기 위해 판매 성공해야하는 최소 고객 수와 이 때 마지막으로 판매에 성공하는 고객 번호를 구해보자.

🔍 풀이 방법

[사용한 알고리즘]

  • 배낭 문제

dp[x][c] = 두 제품 중 첫 번째 제품을 x만큼 판매했고 고객 c명에게 판매 성공했을 때, 두 번째 제품 판매량의 최댓값
rec[x][c] = dp[x][c]가 Y를 넘은 경우, 마지막으로 판매에 성공한 고객 번호
위와 같이 dp를 정의하고 배낭 문제 풀이법을 적용하여 풀었다.

⏳ 회고

답이 될 수 있는 상황을 모두 고려하지 않고 풀어서 틀렸었다

@oncsr oncsr added the success 👍 해설을 보지 않고 풀었을 때 label Apr 7, 2025
@ShinHeeEul ShinHeeEul merged commit a0650cb into main Apr 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

success 👍 해설을 보지 않고 풀었을 때

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants